package com.ybfenpan.response;

/**
 * 后台统一返回json封装对象
 * @author lzx
 */
public class Resp {

    public boolean success = true;
    public Integer status = 0;
    public String message = "";
    //重定向地址
    public String referrer;
    //传输到前端对象数据
    public Object data;

    public Resp(){}

    public Resp(Integer status){
        this(status,"");
    }

    public Resp(Integer status, String message){
        this(status,message,null);
    }

    public Resp(Integer status, String message, String referrer){
        this(status,message,referrer,null);
    }

    public Resp(Integer status, String message, String referrer, Object data){
        this.status = status;
        this.message = message;
        this.referrer = referrer;
        this.data = data;
        this.success = status >= 0;
    }
}
